/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package mywork04;
import javax.swing.JOptionPane;
import java.lang.Number;
/**
 *
 * @author sara
 */
public class MyWork04 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        String str=new String();
        int n1,n3;
        String out2;
        if(args.length==0)
        {
            String out1="please input an integer number:";
            out1=JOptionPane.showInputDialog(null,out1);
            out2="please input u(unsigned) or s(signed):";
            out2=JOptionPane.showInputDialog(null,out2);
            String out3="please input radix:";
            out3=JOptionPane.showInputDialog(null,out3);
            n1=Integer.parseInt(out1);
            n3=Integer.parseInt(out3);

        }
        else
        {
            n1=Integer.parseInt(args[0]);
            n3=Integer.parseInt(args[2]);
            out2=args[1];
        }
        if(out2=="u")
                conversion.conver(n1,n3);
        else
        {
            String n;
            n=Integer.toString(n1,n3);
            JOptionPane.showMessageDialog(null,n+"\n","conversion",JOptionPane.PLAIN_MESSAGE);
        }
    }

    
}
